<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSkus extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('skus', function (Blueprint $table) {
            $table->id();
            $table->string('sku',30);
            $table->string('name',100);
            $table->integer('category_id')->nullable();
            $table->tinyInteger('is_sale');
            $table->decimal('cute_l')->nullable();
            $table->decimal('cute_w')->nullable();
            $table->decimal('cute_h')->nullable();
            $table->decimal('weight')->nullable();
            $table->decimal('net_weight')->comment('净重(克)')->nullable();
//            $table->string('supplier_no')->nullable();
//            $table->string('purchase_cycle')->nullable();
            $table->unique('sku');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('skus');
    }
}
